import 'package:flutter/material.dart';
import 'package:simple_animations/simple_animations.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      home: Scaffold(
        appBar: AppBar(
          title: Text('动画测试'),
        ),
        body: Stack(
          children: [
            Positioned.fill(child: AnimateBg()),
          ],
        ),
      ),
    );
  }
}

enum _ColorTween { color1, color2 }

class AnimateBg extends StatelessWidget {
  const AnimateBg({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final tween = MultiTween<_ColorTween>()
      ..add(
        _ColorTween.color1,
        ColorTween(begin: Color(0xffD38312), end: Colors.lightBlue.shade900),
      )
      ..add(_ColorTween.color2,
          ColorTween(begin: Color(0xffA83279), end: Colors.blue.shade600));
    return Container();
  }
}
